package exception;


import java.io.FileNotFoundException;

public class ThrowDemo {
    public static void main(String[] args)  {
        Student a=new Student();
        try {
            a.setAge(40);
        }catch (IllegalAgeException e){
            System.out.println("解决异常");
        }
            System.out.println("他的年纪为" + a.getAge());
    }
}
